@import '@/assets/styles/var.less';

.user-center {
    background: linear-gradient(135deg, #07c160 0%, #006f49 100%);
    height: 100%;
    overflow-y: auto;

    // 用户信息头部 - 毛玻璃效果
    .user-header {
        position: relative;
        padding: 40px 20px 30px;
        overflow: hidden;

        .header-background {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 0 0 30px 30px;
        }

        .header-content {
            position: relative;
            z-index: 2;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;

            .user-info {
                display: flex;
                align-items: center;
                gap: 16px;
                flex: 1;

                .avatar-container {
                    position: relative;
                    cursor: pointer;
                    transition: all 0.3s ease;

                    &:hover {
                        transform: scale(1.05);
                    }

                    &:active {
                        transform: scale(0.95);
                    }

                    .user-avatar {
                        border: 4px solid rgba(255, 255, 255, 0.3);
                        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
                    }

                    .level-badge {
                        position: absolute;
                        bottom: -5px;
                        right: -5px;
                        width: 28px;
                        height: 28px;
                        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
                        border-radius: 50%;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        color: #333;
                        font-size: 14px;
                        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
                    }
                }

                .user-details {
                    color: white;
                    flex: 1;

                    .user-name {
                        font-size: 24px;
                        font-weight: 700;
                        margin-bottom: 8px;
                        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                        cursor: pointer;
                        transition: all 0.3s ease;
                        padding: 4px 8px;
                        border-radius: 8px;

                        &:hover {
                            background: rgba(255, 255, 255, 0.1);
                            transform: translateY(-1px);
                        }

                        &:active {
                            transform: translateY(0);
                            background: rgba(255, 255, 255, 0.2);
                        }
                    }

                    .user-level {
                        display: flex;
                        align-items: center;
                        gap: 6px;
                        font-size: 14px;
                        opacity: 0.9;
                        margin-bottom: 12px;

                        .nut-icon {
                            font-size: 16px;
                        }
                    }

                    .level-progress {
                        .progress-info {
                            display: flex;
                            justify-content: space-between;
                            align-items: center;
                            font-size: 12px;
                            opacity: 0.8;
                            margin-bottom: 6px;

                            .progress-text {
                                font-weight: 600;
                                color: #ffd700;
                            }
                        }

                        .progress-bar {
                            .nut-progress-outer {
                                background: rgba(255, 255, 255, 0.2);
                                border-radius: 10px;
                                height: 6px;
                            }

                            .nut-progress-inner {
                                background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
                                border-radius: 10px;
                            }
                        }
                    }
                }
            }

            .edit-btn {
                background: rgba(255, 255, 255, 0.2);
                border: 1px solid rgba(255, 255, 255, 0.3);
                color: white;
                font-size: 12px;
                padding: 8px 16px;
                border-radius: 20px;
                backdrop-filter: blur(10px);
                -webkit-backdrop-filter: blur(10px);

                &:active {
                    background: rgba(255, 255, 255, 0.3);
                }
            }
        }
    }

    // 订单状态区域
    .order-section {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        margin: -10px 20px 20px;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 3;

        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 20px 16px;
            border-bottom: 1px solid #f0f0f0;

            .order-title {
                font-size: 18px;
                font-weight: 600;
                color: #333;
            }

            .order-more {
                font-size: 14px;
                color: #999;
                display: flex;
                align-items: center;
                gap: 4px;

                .nut-icon {
                    font-size: 12px;
                }
            }
        }

        .order-status {
            display: flex;
            padding: 20px 0;

            .status-item {
                flex: 1;
                display: flex;
                flex-direction: column;
                align-items: center;
                position: relative;
                cursor: pointer;
                transition: all 0.3s ease;
                padding: 8px;
                border-radius: 8px;

                &:hover {
                    background-color: rgba(0, 0, 0, 0.02);
                }

                &:active {
                    transform: scale(0.95);
                    background-color: rgba(0, 0, 0, 0.05);
                }

                .status-icon {
                    font-size: 28px;
                    margin-bottom: 8px;
                }

                .status-label {
                    font-size: 13px;
                    color: #666;
                    font-weight: 500;
                }

                .status-badge {
                    position: absolute;
                    top: 0;
                    right: 50%;
                    transform: translateX(50%);
                    min-width: 18px;
                    height: 18px;
                    font-size: 10px;
                    background: #ff4757;
                    color: white;
                }
            }
        }
    }

    // 统计数据区域
    .stats-section {
        margin: 0 20px 20px;

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;

            .stat-card {
                background: rgba(255, 255, 255, 0.95);
                backdrop-filter: blur(20px);
                -webkit-backdrop-filter: blur(20px);
                border-radius: 16px;
                padding: 20px 12px;
                text-align: center;
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
                transition: all 0.3s ease;

                &:active {
                    transform: translateY(-2px);
                    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
                }

                .stat-icon {
                    width: 40px;
                    height: 40px;
                    margin: 0 auto 12px;
                    border-radius: 12px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: white;

                    .nut-icon {
                        font-size: 20px;
                    }
                }

                .stat-content {
                    .stat-value {
                        font-size: 18px;
                        font-weight: 700;
                        color: #333;
                        margin-bottom: 4px;
                    }

                    .stat-label {
                        font-size: 12px;
                        color: #666;
                    }
                }
            }
        }
    }

    // 功能菜单区域
    .menu-section {
        margin: 0 20px 20px;

        .menu-list {
            // background: rgba(255, 255, 255, 0.95);
            // backdrop-filter: blur(20px);
            // -webkit-backdrop-filter: blur(20px);
            // border-radius: 10px;
            overflow: hidden;
            // box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

            .menu-item {
                border-bottom: 1px solid #f0f0f0;
                position: relative;
                transition: all 0.3s ease;

                &:last-child {
                    border-bottom: none;
                }

                &:active {
                    background: #f5f5f5;
                }

                .nut-cell__title {
                    font-size: 15px;
                    color: #333;
                    font-weight: 500;
                }

                .nut-icon {
                    margin-right: 12px;
                    font-size: 20px;
                }

                .nut-cell__right-icon {
                    color: #ccc;
                    font-size: 14px;
                }

                .menu-badge {
                    position: absolute;
                    right: 40px;
                    top: 50%;
                    transform: translateY(-50%);
                    min-width: 18px;
                    height: 18px;
                    font-size: 10px;
                    background: #ff4757;
                    color: white;
                }
            }
        }
    }

    // 底部操作区域
    .bottom-actions {
        padding: 0 20px;
        margin-top: 32px;

        .logout-btn {
            width: 100%;
            height: 52px;
            border-radius: 26px;
            font-size: 16px;
            font-weight: 600;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: #666;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

            &:active {
                background: rgba(255, 255, 255, 0.8);
                transform: translateY(1px);
            }
        }
    }
}

// 响应式设计
@media (max-width: 375px) {
    .user-center {
        .user-header {
            padding: 30px 16px 20px;

            .header-content {
                .user-info {
                    gap: 12px;

                    .user-details {
                        .user-name {
                            font-size: 20px;
                        }
                    }
                }
            }
        }

        .order-section,
        .stats-section,
        .menu-section {
            margin-left: 16px;
            margin-right: 16px;
        }

        .order-section {
            .order-header {
                padding: 16px 16px 12px;

                .order-title {
                    font-size: 16px;
                }

                .order-more {
                    font-size: 13px;
                }
            }

            .order-status {
                padding: 16px 0;

                .status-item {
                    .status-icon {
                        font-size: 24px;
                        margin-bottom: 6px;
                    }

                    .status-label {
                        font-size: 12px;
                    }
                }
            }
        }

        .stats-section {
            .stats-grid {
                gap: 8px;

                .stat-card {
                    padding: 16px 8px;

                    .stat-icon {
                        width: 36px;
                        height: 36px;

                        .nut-icon {
                            font-size: 18px;
                        }
                    }

                    .stat-content {
                        .stat-value {
                            font-size: 16px;
                        }

                        .stat-label {
                            font-size: 11px;
                        }
                    }
                }
            }
        }

        .menu-section {
            .menu-list {
                .menu-item {
                    padding: 16px 16px;

                    .nut-cell__title {
                        font-size: 14px;
                    }

                    .nut-icon {
                        font-size: 18px;
                        margin-right: 10px;
                    }
                }
            }
        }

        .bottom-actions {
            padding: 0 16px;
        }
    }
}

// 超小屏幕适配
@media (max-width: 320px) {
    .user-center {
        .stats-section {
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .order-section {
            .order-status {
                .status-item {
                    .status-icon {
                        font-size: 20px;
                    }

                    .status-label {
                        font-size: 11px;
                    }
                }
            }
        }

        .menu-section {
            .menu-list {
                .menu-item {
                    padding: 14px 12px;

                    .nut-cell__title {
                        font-size: 13px;
                    }

                    .nut-icon {
                        font-size: 16px;
                        margin-right: 8px;
                    }
                }
            }
        }
    }
}